<template>
	<view class="goods_list">		
		<view class="goods_item" v-for="item in goods" :key="item.id" @click="navigator(item.id)">
			<image :src="item.img_url"></image>
			<view class="price">
				<text>￥{{item.sell_price}}</text>
				<text>￥{{item.market_price}}</text>
			</view>
			<view class="name">
				{{item.title}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:['goods'],
		methods:{
			navigator(id){
				this.$emit('goodsItemClick',id)
			}
		}
	}
</script>

<style lang="scss">
	.goods_list{
		background-color: #eee;
		padding: 0 15rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content:space-between;
		.goods_item{
			background-color: #fff;
			width: 355rpx;
			margin-bottom: 10rpx;
			padding: 15rpx;
			box-sizing: border-box;
			image{
				width: 80%;
				height: 300rpx;
				display: block;
				margin: 0 auto;
			}
			.price{
				margin-top: 10rpx;
				color:$shop-color;
				font-size: 35rpx;
				text:nth-child(2){
					font-size: 25rpx;
					color: #ccc;
					margin-left: 17rpx;
					text-decoration: line-through;
				}
			}
			.name{
				font-size: 28rpx;
				line-height: 50rpx;
				padding-bottom: 15rpx;
				padding-top: 10rpx;
			}
		}
	}
</style>
